using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

/**
*@file       PSObject_EnterWorldSender.cs
*@brief      send message PSObject_EnterWorld
*
*@author     graywind
*@version    1.0.0.1
*@data       2012/3/26
*/

//send message PSObject_EnterWorld
public class msgPSObject_EnterWorld
{
    public const int MessageId = (int)PosServerTypes.MessageType.PSObject_EnterWorld;
    //TODO
	public int SessionId = NetLib.INVALID_SESSION;
	public objectinfo.LogicObject MsgContent = null;
	/// <summary>
	/// Initializes a new instance of the <see cref="msgPSObject_EnterWorld"/> class.
	/// </summary>
	/// <param name='session_id'>
	/// Session_id.
	/// </param>
	/// <param name='obj'>
	/// Object.
	/// </param>
	public msgPSObject_EnterWorld(int session_id, objectinfo.LogicObject obj)
	{
		SessionId = session_id;
		MsgContent = obj;
	}
}

//handle message
public partial class gwMessagePort
{
    /// <summary>
    /// handle message
    /// </summary>
    /// <param name="msg">message wrapper of PSObject_EnterWorld</param>
    public static void ProcessMessage(msgPSObject_EnterWorld msg)
    {
        //TODO
        //Main Message:  msgPosServer
		msgPosServer mainMsg = new msgPosServer(msg.SessionId, msgPSObject_EnterWorld.MessageId, ProtoNet<objectinfo.LogicObject>.IntoBytes(msg.MsgContent));
		gwMessagePort.ProcessMessage(mainMsg);
    }
}
